package com.chj.design.sk;

public class Code13_Proxy2 {
	/** 表演 */
	public interface Performance {
		void act();
	}

	/** 明星 */
	public static class Actor implements Performance {
		@Override
		public void act() {
			System.out.println("明星上场拍功夫电影");
		}
	}

	/**
	 * 替身演员
	 */
	public static class Stuntman implements Performance {

		private Actor actor;

		@Override
		public void act() {
			if (actor == null) {
				actor = new Actor();
			}

			System.out.println("替身演员表演跳火车.");
			actor.act();
			System.out.println("替身演员表演空中360°旋转飞踢.");
		}
	}

	public static void main(String[] args) {
		System.out.println("------电影拍摄开始------");
		Performance perform = new Stuntman();
		perform.act();
		System.out.println("------电影拍摄结束------");
	}
}
